package com.yf.springboot.springboot.config;

import cn.weiguangfu.swagger2.plus.annotation.EnableSwagger2Plus;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

import java.util.ArrayList;

@Configuration
@EnableSwagger2Plus
public class Swagger2Config {

    @Bean
    public Docket docket() {
        return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(
                new ApiInfo(
                    "接口文档",
                    "该文档描述了**项目接口信息",
                    "1.1",
                    "",
                    new Contact("yvan", "", "57882634@qq.com"),
                    "",
                    "",
                    new ArrayList<>()
                )
            ).groupName("runze").select().apis(
                RequestHandlerSelectors.basePackage("com.yf.springboot")
            ).build();
    }

}
